package com.example.demo.controller;

import com.example.demo.entity.Admin;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import com.example.demo.service.IAdminService;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Baomidou
 * @since 2025-06-12
 */
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Resource
    IAdminService adminService;
    @GetMapping("/list")
    List<Admin> list() {
        /*List<Admin> list = new ArrayList<>();
        for (int i = 0; i < 10; i++)
        {
            Admin  admin = new Admin( "username" + i, "password" + i, "admin" );
            list.add(admin);
        }

        return adminService.saveBatch(list);*/
        return adminService.list();
    }
}
